ferror[test whether read/write error has occurred]

Contents|Index|Previous|Next

ferror
[test whether read/write error has occurred]

SYNOPSIS
#include <stdio.h>
int ferror(FILE *fp);

DESCRIPTION
The stdio functions maintain an error indicator with each file pointer fp, to record whether any read or write errors have occurred on the associated file or stream. Use ferror to query this indicator.

See clearerr to reset the error indicator.

RETURNS
ferror returns 0 if no errors have occurred; it returns a nonzero value otherwise.

COMPLIANCE
ANSI C requires ferror.

No supporting OS subroutines are required.